import { BrowserRouter, Routes, Route, Link } from "react-router-dom";
import Home from "@/pages/home/index";
import CounterPage from "@/pages/demo/CounterPage";
import { ConfigProvider } from "antd";
// 导航组件
const Navbar = () => (
  <nav className="navbar">
    <Link to="/" className="nav-link">
      首页
    </Link>
    <Link to="/counter" className="nav-link">
      路由2
    </Link>
  </nav>
);

// 路由配置
const AppRoutes = () => (
  <ConfigProvider
    theme={{
      token: {
        colorPrimary: `var(--colorPrimary)`,
        colorBgContainer: `var(--colorBgContainer)`,
        colorText: `var(--colorText)`,
        colorBorder: `var(--colorBorder)`,
      },
    }}
  >
    <BrowserRouter>
      <Navbar />
      <Routes>
        <Route path="/" element={<Home />} />
        <Route path="/counter" element={<CounterPage />} />
      </Routes>
    </BrowserRouter>
  </ConfigProvider>
);

export default AppRoutes;
